package com.rpay.web.service;
/**
 * @author XXX
 * @mail XXX@hotmail.com
 * @date 2018/5/7
 * @Description:
 */

import com.rpay.common.dto.question.QuestionDTO;
import com.rpay.common.dto.question.QuestionQueryDTO;
import com.rpay.service.question.IQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class QuestionService {
    @Autowired
    private IQuestionService iQuestionService;

    public QuestionQueryDTO data(String questionType, Integer page, Integer pageSize) {
        QuestionQueryDTO query = new QuestionQueryDTO();
        query.setVisible(1);
        query.setQuestionType(questionType);
        query.setPage((page - 1) * pageSize);
        query.setPageSize(pageSize);
        QuestionQueryDTO data = iQuestionService.getDataList(query, page, pageSize);
        return data;
    }

    public QuestionDTO detail(Integer id) {
        QuestionDTO query=new QuestionDTO();
        query.setId(id);
        query.setVisible(1);
        QuestionDTO detail = iQuestionService.getDetail(query);
        return detail;
    }
}
